﻿@{
    Layout = null;
    var plugName = @user.admin.cyt369.com.Areas.UserAdmin.Models.PlugName.Name;
    var tableName = PageViewModel.PageTableID(this, plugName);
    var tableToolBar = PageViewModel.PageTableToolbar(this, plugName);
    var tableToolBarSearch = PageViewModel.PageTableToolbarSearch(this, plugName);
    var tableToolBarReset = PageViewModel.PageTableToolbarReset(this, plugName);

    var iconFmtFun = PageViewModel.PageFunctionName(this, "icon_fmt", plugName);

}
<div style="height:100%">
    <script type="text/javascript">
    function @iconFmtFun (v,r,i){
        var style = 'width:30px;height:30px;border-radius:15px;line-height:30px;text-align:center;font-size:25px;color:#eee;margin-left:8px;';
        if (!$.IsNullOrEmpty(v)) {
            return $.ImageFormat(v, r, i, style);
        } else {
            return $.ImageFormat(r.Avatar, r, i, style);
        }
    }
    </script>
    <script type="text/javascript">
    function @tableToolBarSearch {
        $('#@tableName').datagrid('load', {
            LoginName: $("#@tableToolBar").find("#LoginName").textbox("getValue"),
            FullName: $("#@tableToolBar").find("#FullName").textbox("getValue"),
        });
    }


    function @tableToolBarReset {
        $("#@tableToolBar").find("#LoginName").textbox("setValue", "");
        $("#@tableToolBar").find("#FullName").textbox("setValue", "");
       @tableToolBarSearch;
    }
    </script>
    <!-- -->
    <table id="@tableName" class="easyui-datagrid" style="width:100%" rownumbers="true" fitColumns="true" fit="true"
           pagination="true" pageSize="@SystemSettingService.Instance.PageSize" pageList="@SystemSettingService.Instance.PageList"
           data-options="striped:true,border:false,singleSelect:true,url:'~/@plugName/Users/GetUsers',method:'get',toolbar:'#@tableToolBar'">
        <thead>
            <tr>
                <th data-options="field:'HeaderUrl',width:60,align:'center',formatter:@iconFmtFun"></th>
                <th data-options="field:'UserName',width:100">登录名</th>
                <th data-options="field:'FullName',width:100">真实名</th>
                <th data-options="field:'Gender',width:100,align:'center'">性别</th>
                <th data-options="field:'UserType',width:100">用户类型</th>
                <th data-options="field:'Status',width:100">状态</th>
                <th data-options="field:'PhoneNumber',width:100">手机号</th>
                <th data-options="field:'Email',width:100">邮件</th>
                <th data-options="field:'Address',width:100">地址</th>
                <th data-options="field:'AccessFailedCount',width:100,align:'center'">访求错误次数</th>
                <th data-options="field:'IsInternal',width:100,align:'center',formatter:$.CheckdFormat">系统账户</th>
                <th data-options="field:'UniqueCode',width:100,align:'center'">内部编码</th>
                <th data-options="field:'CreatedTime',width:100,align:'center',formatter:$.DateFmt">注册时间</th>
                <th data-options="field:'Remark',width:100">备注</th>
            </tr>
        </thead>
    </table>
    <div id="@tableToolBar" class="easyui-panel table-toolbar">
        <ul class="query-body">
            <li>
                <span>登录名：</span>
                <input id="LoginName" class="easyui-textbox" />
            </li>
            <li>
                <span>真实名：</span>
                <input id="FullName" class="easyui-textbox" />
            </li>
            <li>
                <a href="javascript:@tableToolBarSearch" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a>
                <a href="javascript:@tableToolBarReset" class="easyui-linkbutton" data-options="iconCls:'icon-reload'">重置</a>
            </li>
        </ul>
    </div>
</div>